﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using DomainDriver.CommonUtilities.Enums;
using DomainDriver.DomainModeling.DataProviders;
using DomainDriver.DomainModeling.GenericUnitTesting.Repositories;
using AutomotivePricingModel.Countries;

namespace AutomotivePricingModel.UnitTests.Repositories
{
    [TestFixture(new object[] { DataSourcePersistenceType.None })]
    [TestFixture(new object[] { DataSourcePersistenceType.File })]
    [TestFixture(new object[] { DataSourcePersistenceType.Database })]
    public class CountryRepositoryTests : RepositoryTestFixture<AutomotivePricingDomainModel, Guid, Country>
    {
        public CountryRepositoryTests(DataSourcePersistenceType persistenceType)
            : base(persistenceType)
        {
            // do nothing
        }

        protected override AutomotivePricingDomainModel CreateDomainModel(DataSourcePersistenceType persistenceType, bool buildModelWithConstraints)
        {
            AutomotivePricingDomainModel model = new AutomotivePricingDomainModel(persistenceType, buildModelWithConstraints);
            return model;
        }

        protected override Country CreateDomainObject()
        {
            Country domainObject = new Country();
            domainObject.Name = domainObject.Key.ToString();
            return domainObject;
        }

        protected override void UpdateDomainObject(Country domainObject, ref bool objectCanBeUpdated)
        {
            objectCanBeUpdated = true;
            domainObject.Name += " UPDATED";
        }
    }
}